home *** CD-ROM | disk | FTP | other *** search
- /* mvedata1.c, from p.157 of Turbo C Bible */
- /* Copies a specified number of bytes of a buffer to a another
- in possibly different segment. */
- #include <stdio.h>
- #include <dos.h> /* For FP_OFF and FP_SEG */
- #include <mem.h>
- static char buffer[41]; /* Destination buffer */
- main()
- {
- void far *address;
- unsigned bufseg, bufoff;
- address = (void far *)buffer;/* Get segment and offset address */
- bufseg = FP_SEG(address); /* of buffer */
- bufoff = FP_OFF(address);
- movedata(0xf000, 0xe000, bufseg, bufoff, 22);
- buffer[22] = '\0';
- /* Use the 'F' address modifier when printing buffer */
- printf("The buffer now contains: %s\n", buffer);
- }